﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PMS.ENT;
using PMS.DAL;

namespace PMS.BLL
{
    public class SubjectBLL
    {
        #region Get
        public static SubjectENT GetSubjectByID(int subjectID)
        {
            try
            {
                return SubjectDAL.GetSubjectByID(subjectID);
            }
            catch (Exception)
            {
                throw;
            }
        }

        public static SubjectCollection GetSubjectList(string subjectname, string subjectcode, int departmentID, string orderBy, string orderDirection, int page, int pageSize, out int totalRecords)
        {
            try
            {
                return SubjectDAL.GetSubjectList(subjectname,subjectcode, departmentID, orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (Exception)
            {
                throw;
            }
        }

        public static SubjectCollection GetSubjectListForCMB(int departmentID)
        {
            try
            {
                SubjectCollection listSubject = new SubjectCollection();
                listSubject.Add(new SubjectENT { SubjectID = 0, SubjectName = "--All--" });
                listSubject.AddRange(SubjectDAL.GetSubjectListForCMB(departmentID));
                return listSubject;
            }
            catch (Exception)
            {

                throw;
            }
        }
        #endregion

        #region Insert Update Delete Subject


        public static int InsertSubject(SubjectENT Subject)
        {
            try
            {
                return SubjectDAL.InsertSubject(Subject);
            }
            catch (Exception)
            {

                throw;
            }
        }


        public static int UpdateSubject(SubjectENT SubjectID)
        {
            try
            {
                return SubjectDAL.UpdateSubject(SubjectID);
            }
            catch (Exception)
            {

                throw;
            }
        }

        public static int DeleteSubject(int SubjectID, int UserID)
        {
            try
            {
                return SubjectDAL.DeleteSubject(SubjectID, UserID);
            }
            catch (Exception)
            {

                throw;
            }
        }




        #endregion
    }
}
